import { defineStore } from 'pinia'
import { ref } from 'vue'
// 组合式
export const useCounterStore = defineStore(
  'counter',
  () => {
    const token = ref('')
    const userInfo = ref({
      avatar:'', // 头像
      name:'', // 姓名
      number:'', // 司机编号
      phone:'' // 手机号码
    })
    return { token,userInfo }
  },
  {
    persist: {
      storage: {
        getItem(key) {
          return uni.getStorageSync(key)
        },
        setItem(key, token) {
          uni.setStorageSync(key, token)
        },
      },
    },
  }
)
